package com.sxj.corejava.code07_面向对象;

/**
 * @author 石小俊
 * 2024年07月12日 16:22
 */
public class Test05_方法重载 {

    public static void main(String[] args) {
        Calculator c = new Calculator();
        int sum = c.sum(1, 2);
        double sum2 = c.sum(1.23, 3.14);
        int sum3 = c.sum(1, 2, 3);
    }

}

class Calculator {
    public int sum(int i, int j) {
        return i + j;
    }

    public double sum(double i, double j) {
        return i + j;
    }

    public int sum(int i, int j, int k) {
        return i + j + k;
    }

    public double sum(int i, double j) {
        return i + j;
    }

    public double sum(double i, int j) {
        return i + j;
    }
}
